/**
 *  Copyright (c)  2011-2020 Panguso, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Panguso, 
 *  Inc. ("Confidential Information"). You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into with Panguso.
 */


package cn.edu.thu.log.preprocessrule;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * define how to identify activites
 * 
 * @author wan
 * 
 */
public class ActivityIdentifyRule {
	private String activityname;
	private String actexpression;
	private ArrayList<String> activityFormat;
	private Map<String, String> activityIdentifyRules;
	private Set<String> allAnalyzedProducts;
	private String timestamp = null;
/**
 * 
 */
	public ActivityIdentifyRule() {
		allAnalyzedProducts = new HashSet<String>();
		activityIdentifyRules = new HashMap<String, String>();
		// activityIdentifyRules=new HashSet<Map<String,String>>();
	}
/**
 * 
 * @param analyzedproduct parameter
 */
	public void addAnalyzedProduct(String analyzedproduct) {
		allAnalyzedProducts.add(analyzedproduct);
	}

	public Set<String> getAllAnalyzedProducts() {
		return allAnalyzedProducts;
	}
/**
 * 
 * @param newactivityname parameter
 * @param newactexpression parameter
 */
	public void addActivityIdentifyRule(String newactivityname,
			String newactexpression) {
		// if (!activityIdentifyRules.containsKey(activityname)) {
		activityIdentifyRules.put(newactivityname, newactexpression);
		this.activityname = newactivityname;
		this.actexpression = newactexpression;
		/*
		 * } else //
		 * System.out.println("Already give the format of the activity" +
		 * activityname);
		 */
	}
/**
 * 
 * @return
 */
	public ArrayList<String> getAcitivityFormat() {
		activityFormat = new ArrayList<String>();
		activityFormat.add(activityname);
		activityFormat.add(actexpression);
		return activityFormat;
	}

	public Map<String, String> getAllActivityIdentifyRules() {
		return activityIdentifyRules;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public String getActivityname() {
		return activityname;
	}

	public void setActivityname(String activityname) {
		this.activityname = activityname;
	}

	public String getActexpression() {
		return actexpression;
	}

	public void setActexpression(String actexpression) {
		this.actexpression = actexpression;
	}

	public ArrayList<String> getActivityFormat() {
		return activityFormat;
	}

	public void setActivityFormat(ArrayList<String> newactivityformat) {
		this.activityFormat = newactivityformat;
	}

	public void setActivityIdentifyRules(
			Map<String, String> activityIdentifyRules) {
		this.activityIdentifyRules = activityIdentifyRules;
	}

	public void setAllAnalyzedProducts(Set<String> allAnalyzedProducts) {
		this.allAnalyzedProducts = allAnalyzedProducts;
	}

}
